public class TesteThread implements Runnable {
    
    private int contador;
    public TesteThread(){
        contador = 1;
    }
    public void  run(){
        
        try{
              while(true){
                System.out.println(contador++);
                Thread.sleep(1000);
              }   
           }           
        catch  (InterruptedException e) {
            e.printStackTrace();
        }     
    }
            
    
    
}